package com.raymond.cmpp.client.codec.decoding;

import com.raymond.cmpp.common.codec.annotation.MsgCodec;
import com.raymond.cmpp.common.codec.decoding.BaseDecoder;
import com.raymond.cmpp.common.enums.CommandIdType;
import com.raymond.cmpp.common.msg.BaseAgreement;
import com.raymond.cmpp.common.msg.request.ActiveTestRequestMessage;
import com.raymond.cmpp.common.msg.response.ActiveTestResponseMessage;
import io.netty.channel.ChannelHandlerContext;

import java.util.List;

/**
 * 链路测试请求
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-08-10 15:28
 */
@MsgCodec(commandId = CommandIdType.ACTIVE_TEST_REQUEST)
public class ActiveTestRequestMessageDecoder extends BaseDecoder {
    @Override
    public void decode(ChannelHandlerContext ctx, BaseAgreement msg, List<Object> out) throws Exception {
        ctx.writeAndFlush(new ActiveTestRequestMessage(msg.getSequenceId()));
    }
}
